<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ include file="/commons/global.jsp"%>

<html>
<head>
    <title>${sys_name}</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <%@ include file="/commons/head.jsp"%>

</head>
<body class="login-bg">
    
    <div class="login">
        <div class="message">巡查综合管理登录</div>
        <div id="darkbannerwrap"></div>
        
        <form method="post" class="layui-form" id="myform" action="">
            <input name="username" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">

            <button class="layui-btn" lay-submit="" lay-filter="add" style="width:100%;" >登录</button>

        </form>
    </div>

    <script>

       $(function  () {
           layui.use('form', function(){
           var form = layui.form;
            form.on('submit(add)', function(data){
                $.post('<%=basePath%>user/valid',data.field,function(res){
                    if(res.flag){
                        layer.msg(res.msg, {time: 2000});
                        var url = '<%=basePath%>home/main'; //
                        setTimeout(window.location.href=url,2000);
                    }else{
                        layer.msg(res.msg, {time: 2000});
                    }
                },'json');
                return false;
            });
        });
       })




    </script>


</body>
</html>